/* Copyright (c) 2010 OFXKit
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import <Foundation/Foundation.h>
#import "OFXInvestmentStatement.h"
#import "OFX401kSummaryInfo.h"

@interface OFX401kInvestmentStatement : OFXInvestmentStatement {
  NSNumber* cashBalance;
  NSNumber* preTaxSecurityValue;
  NSNumber* afterTaxSecurityValue;
  NSNumber* valueOfSecuritiesPurchasedWithMatch;
  NSNumber* valueOfSecuritiesPurchasedWithProfitSharing;
  NSNumber* valueOfRollOverSecurities;
  NSNumber* valueOfSecuritiesPurchasedWithOtherVestingFunds;
  NSNumber* valueOfSecuritiesPurchasedWithOtherNonVestingFunds;
  NSNumber* totalAmount;
  NSString* employerName;
  NSString* planId;
  NSDate*   planJoinDate;
  NSString* employerContactInfo;
  NSString* brokerContactInfo;
  NSNumber* percentSalaryDeferredBeforeTax;
  NSNumber* percentSalaryDeferredAfterTax;
  NSNumber* dollarForDollarMatchPercent;
  NSNumber* maxMatchAmount;
  NSNumber* maxMatchPercentOfSalary;
  NSDate*   startOfYear;
  NSNumber* baseMatchAmount;
  NSNumber* baseMatchPercentOfSalary;
  NSMutableArray*  contributionInfo;
  NSNumber* currentVestedPercent;
  NSMutableArray* vestingInfo;
  NSMutableArray* loanInfo;
  OFX401kSummaryInfo* yearToDateSummaryInfo;
  OFX401kSummaryInfo* inceptionToDateSummaryInfo;
  OFX401kSummaryInfo* periodToDateSummaryInfo;
}

/**
 * @property cashBalance
 * @brief Cash balance available for the 401(k) account
 */
@property(retain) NSNumber* cashBalance;

/**
 * @property preTaxSecurityValue
 * @brief Current value of all securities purchased with Before Tax Employee 
 * contributions
 */
@property(retain) NSNumber* preTaxSecurityValue;

/**
 * @property afterTaxSecurityValue
 * @brief Current value of all securities purchased with After Tax Employee 
 * contributions
 */
@property(retain) NSNumber* afterTaxSecurityValue;

/**
 * @property valueOfSecuritiesPurchasedWithMatch
 * @brief Current value of all securities purchased with Employer Match 
 * contributions
 */
@property(retain) NSNumber* valueOfSecuritiesPurchasedWithMatch;

/**
 * @property valueOfSecuritiesPurchasedWithProfitSharing
 * @brief Current value of all securities purchased with Employer Profit 
 * Sharing contributions
 */
@property(retain) NSNumber* valueOfSecuritiesPurchasedWithProfitSharing;

/**
 * @property valueOfRollOverSecurities
 * @brief Current value of all securities purchased with Rollover contributions
 */
@property(retain) NSNumber* valueOfRollOverSecurities;

/**
 * @property valueOfSecuritiesPurchasedWithOtherVestingFunds
 * @brief Current value of all securities purchased with Other (vesting) 
 * Employer contributions
 */
@property(retain) NSNumber* valueOfSecuritiesPurchasedWithOtherVestingFunds;

/**
 * @property valueOfSecuritiesPurchasedWithOtherNonVestingFunds
 * @brief Current value of all securities purchased with Other (non-vesting) 
 * Employer contributions
 */
@property(retain) NSNumber* valueOfSecuritiesPurchasedWithOtherNonVestingFunds;

/**
 * @property employerName
 * @brief Name of employer where 401(k) is held
 */
@property(retain) NSString* employerName;

/**
 * @property planId
 * @brief Unique identifier of plan
 */
@property(retain) NSString* planId;

/**
 * @property planJoinDate
 * @brief Date the employee joined the plan
 */
@property(retain) NSDate*   planJoinDate;

/**
 * @property employerContactInfo
 * @brief Name of contact person at employer, plus any available contact 
 * information, such as phone number, A-255
 */
@property(retain) NSString* employerContactInfo;

/**
 * @property brokerContactInfo
 * @brief Name of contact person at broker, plus any available contact 
 * information, such as phone number, A-255
 */
@property(retain) NSString* brokerContactInfo;

/**
 * @property percentSalaryDeferredBeforeTax
 * @brief Percent of employee salary deferred before tax, rate
 */
@property(retain) NSNumber* percentSalaryDeferredBeforeTax;

/**
 * @property percentSalaryDeferredAfterTax
 * @brief Percent of employee salary deferred after tax, rate
 */
@property(retain) NSNumber* percentSalaryDeferredAfterTax;

/**
 * @property dollarForDollarMatchPercent
 * @brief Percent of employee contribution matched, e.g., 75% if contribution 
 * rate is $0.75/$1.00, rate
 */
@property(retain) NSNumber* dollarForDollarMatchPercent;

/**
 * @property maxMatchAmount
 * @brief Maximum employer contribution amount in any year
 */
@property(retain) NSNumber* maxMatchAmount;

/**
 * @property maxMatchPercentOfSalary
 * @brief Current maximum employer contribution percentage. Maximum match in a 
 * year is MAXMATCHPCT up to the MAXMATCHAMT, if provided.
 */
@property(retain) NSNumber* maxMatchPercentOfSalary;

/**
 * @property startOfYear
 * @brief Specifies when the employer contribution max is reset. Some plans 
 * have a maximum based on the company fiscal year rather than calendar year. 
 * Assume calendar year if omitted. Only the month and day (MMDD) are used; 
 * year (YYYY) and time are ignored.
 */
@property(retain) NSDate*   startOfYear;

/**
 * @property baseMatchAmount
 * @brief Specifies a fixed dollar amount contributed by the employer if the 
 * employee participates in the plan at all. This may be present in addition to
 * the dollarForDollarMatchPercent. $0 if omitted.
 */
@property(retain) NSNumber* baseMatchAmount;

/**
 * @property baseMatchPercentOfSalary
 * @brief Specifies a fixed percent of employee salary matched if the employee
 * participates in the plan at all. This may be present in addition to the 
 * dollarForDollarMatchPercent. 0% if omitted. Base match in a year is 
 * baseMatchPercent up to baseMatchAmount,if provided.
 */
@property(retain) NSNumber* baseMatchPercentOfSalary;

/**
 * @property contributionInfo
 * @brief Array of OFX401kContribution objects defining where contributions
 * come from.
 */
@property(retain) NSMutableArray*  contributionInfo;

/**
 * @property currentVestedPercent
 * @brief Estimated percentage of employer contributions vested as of the 
 * current date. If omitted, assume 100%
 */
@property(retain) NSNumber* currentVestedPercent;

/**
 * @property vestingInfo
 * @brief Array of OFX401kVestingInfo objects defining how much of 
 * different contributions are currently vested.
 */
@property(retain) NSMutableArray* vestingInfo;

/**
 * @property loanInfo
 * @brief Array of OFX401kLoanInfo objects defining loans that have been
 * taken out against the 401k account.
 */
@property(retain) NSMutableArray* loanInfo;

/**
 * @property yearToDateSummaryInfo
 * @brief Summary information about 401k account covering Jan 01 of the current
 * year to statement end date.
 */
@property(retain) OFX401kSummaryInfo* yearToDateSummaryInfo;

/**
 * @property inceptionToDateSummaryInfo
 * @brief Summary information about 401k account covering account inception
 * to statement end date.
 */
@property(retain) OFX401kSummaryInfo* inceptionToDateSummaryInfo;

/**
 * @property periodToDateSummaryInfo
 * @brief Summary information about 401k account covering period start date
 * to period end date.
 */
@property(retain) OFX401kSummaryInfo* periodToDateSummaryInfo;

/**
 * @property totalAmount
 * @brief Sum of value of all securities and cash positions in account.
 */
@property(retain) NSNumber* totalAmount;

/**
 * Copy constructor.  Initialize object with values of an investment statement.
 *
 * @returns An OFX401kInvestmentStatement initialized with the values of the 
 * OFXInvestmentStatement passed in.
 */
- (id)initWithInvestmentStatement:(OFXInvestmentStatement*)statement;

@end
